home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / samples / Multimedia / VBSamples / DirectPlay / Conferencer / frmTransferReq.frm < prev    next >
Text File  |  2001-10-08  |  4KB  |  112 lines

  1. VERSION 5.00
  2. Begin VB.Form frmTransferRequest 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Receiving a file transfer...."
  5.    ClientHeight    =   975
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   4680
  9.    ControlBox      =   0   'False
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   975
  14.    ScaleWidth      =   4680
  15.    StartUpPosition =   3  'Windows Default
  16.    Begin VB.CommandButton cmdReject 
  17.       Cancel          =   -1  'True
  18.       Caption         =   "Reject"
  19.       Height          =   315
  20.       Left            =   3420
  21.       TabIndex        =   3
  22.       Top             =   120
  23.       Width           =   1155
  24.    End
  25.    Begin VB.CommandButton cmdAccept 
  26.       Caption         =   "Accept"
  27.       Default         =   -1  'True
  28.       Height          =   315
  29.       Left            =   3420
  30.       TabIndex        =   2
  31.       Top             =   540
  32.       Width           =   1155
  33.    End
  34.    Begin VB.Label lblFriend 
  35.       BackStyle       =   0  'Transparent
  36.       Height          =   195
  37.       Left            =   720
  38.       TabIndex        =   1
  39.       Top             =   420
  40.       Width           =   2115
  41.    End
  42.    Begin VB.Label Label1 
  43.       BackStyle       =   0  'Transparent
  44.       Caption         =   "You are receiving a file transfer from"
  45.       Height          =   195
  46.       Left            =   720
  47.       TabIndex        =   0
  48.       Top             =   180
  49.       Width           =   2115
  50.    End
  51.    Begin VB.Image Image1 
  52.       Height          =   480
  53.       Left            =   120
  54.       Picture         =   "frmTransferReq.frx":0000
  55.       Top             =   180
  56.       Width           =   480
  57.    End
  58. End
  59. Attribute VB_Name = "frmTransferRequest"
  60. Attribute VB_GlobalNameSpace = False
  61. Attribute VB_Creatable = False
  62. Attribute VB_PredeclaredId = True
  63. Attribute VB_Exposed = False
  64. Option Explicit
  65. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  66. '
  67. '  Copyright (C) 1999-2001 Microsoft Corporation.  All Rights Reserved.
  68. '
  69. '  File:       frmTransferReq.frm
  70. '
  71. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  72. Private msFile As String
  73. Private mlUnique As Long
  74. Private mlPlayerID As Long
  75.  
  76. Private moForm As frmNetwork
  77.  
  78. Public Sub SetupRequest(oForm As frmNetwork, ByVal sPlayerName As String, ByVal sFileName As String, ByVal lUniqueID As Long, ByVal lPlayer As Long)
  79.     Set moForm = oForm
  80.     msFile = sFileName
  81.     mlUnique = lUniqueID
  82.     mlPlayerID = lPlayer
  83.     lblFriend.Caption = sPlayerName & " (" & sFileName & ")"
  84. End Sub
  85.  
  86. Private Sub cmdAccept_Click()
  87.     Dim lMsg As Long, lOffset As Long
  88.     Dim oBuf() As Byte
  89.     
  90.     'Accept this connection
  91.     lMsg = MsgSendFileAccept
  92.     lOffset = NewBuffer(oBuf)
  93.     AddDataToBuffer oBuf, lMsg, LenB(lMsg), lOffset
  94.     AddDataToBuffer oBuf, mlUnique, LenB(mlUnique), lOffset
  95.     dpp.SendTo mlPlayerID, oBuf, 0, DPNSEND_NOLOOPBACK
  96.     Unload Me
  97. End Sub
  98.  
  99. Private Sub cmdReject_Click()
  100.     Dim lMsg As Long, lOffset As Long
  101.     Dim oBuf() As Byte
  102.     
  103.     'Reject this connection
  104.     lMsg = MsgSendFileDeny
  105.     lOffset = NewBuffer(oBuf)
  106.     AddDataToBuffer oBuf, lMsg, LenB(lMsg), lOffset
  107.     AddDataToBuffer oBuf, mlUnique, LenB(mlUnique), lOffset
  108.     dpp.SendTo mlPlayerID, oBuf, 0, DPNSEND_NOLOOPBACK
  109.     moForm.EraseReceiveFile mlUnique
  110.     Unload Me
  111. End Sub
  112.